<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function fn(n) {
            if (n === 0) {
                return 0
            } else if (n === 1) {
                return 1
            } else {
                return fn(n - 1) + fn(n - 2)
            }
        }

        console.log(fn(8));

    </script>
</body>

</html>